<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>ThunarxPropertyPageProvider: thunarx Reference Manual</title>
<meta name="generator" content="DocBook XSL Stylesheets Vsnapshot">
<link rel="home" href="index.html" title="thunarx Reference Manual">
<link rel="up" href="thunarx-providers.html" title="Part V. Providers">
<link rel="prev" href="ThunarxMenuProvider.html" title="ThunarxMenuProvider">
<link rel="next" href="ThunarxPreferencesProvider.html" title="ThunarxPreferencesProvider">
<meta name="generator" content="GTK-Doc V1.33.1 (XML mode)">
<link rel="stylesheet" href="style.css" type="text/css">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="5"><tr valign="middle">
<td width="100%" align="left" class="shortcuts">
<a href="#" class="shortcut">Top</a><span id="nav_description">  <span class="dim">|</span> 
                  <a href="#ThunarxPropertyPageProvider.description" class="shortcut">Description</a></span><span id="nav_hierarchy">  <span class="dim">|</span> 
                  <a href="#ThunarxPropertyPageProvider.object-hierarchy" class="shortcut">Object Hierarchy</a></span><span id="nav_prerequisites">  <span class="dim">|</span> 
                  <a href="#ThunarxPropertyPageProvider.prerequisites" class="shortcut">Prerequisites</a></span>
</td>
<td><a accesskey="h" href="index.html"><img src="home.png" width="16" height="16" border="0" alt="Home"></a></td>
<td><a accesskey="u" href="thunarx-providers.html"><img src="up.png" width="16" height="16" border="0" alt="Up"></a></td>
<td><a accesskey="p" href="ThunarxMenuProvider.html"><img src="left.png" width="16" height="16" border="0" alt="Prev"></a></td>
<td><a accesskey="n" href="ThunarxPreferencesProvider.html"><img src="right.png" width="16" height="16" border="0" alt="Next"></a></td>
</tr></table>
<div class="refentry">
<a name="ThunarxPropertyPageProvider"></a><div class="titlepage"></div>
<div class="refnamediv"><table width="100%"><tr>
<td valign="top">
<h2><span class="refentrytitle"><a name="ThunarxPropertyPageProvider.top_of_page"></a>ThunarxPropertyPageProvider</span></h2>
<p>ThunarxPropertyPageProvider — The interface to extensions that provide additional property pages</p>
</td>
<td class="gallery_image" valign="top" align="right"></td>
</tr></table></div>
<div class="refsect1">
<a name="ThunarxPropertyPageProvider.functions"></a><h2>Functions</h2>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="functions_proto_type">
<col class="functions_proto_name">
</colgroup>
<tbody><tr>
<td class="function_type">
<span class="returnvalue">GList</span> *
</td>
<td class="function_name">
<a class="link" href="ThunarxPropertyPageProvider.html#thunarx-property-page-provider-get-pages" title="thunarx_property_page_provider_get_pages ()">thunarx_property_page_provider_get_pages</a> <span class="c_punctuation">()</span>
</td>
</tr></tbody>
</table></div>
</div>
<div class="refsect1">
<a name="ThunarxPropertyPageProvider.other"></a><h2>Types and Values</h2>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="other_proto_type">
<col class="other_proto_name">
</colgroup>
<tbody>
<tr>
<td class="datatype_keyword"> </td>
<td class="function_name"><a class="link" href="ThunarxPropertyPageProvider.html#ThunarxPropertyPageProvider-struct" title="ThunarxPropertyPageProvider">ThunarxPropertyPageProvider</a></td>
</tr>
<tr>
<td class="datatype_keyword">struct</td>
<td class="function_name"><a class="link" href="ThunarxPropertyPageProvider.html#ThunarxPropertyPageProviderIface" title="struct ThunarxPropertyPageProviderIface">ThunarxPropertyPageProviderIface</a></td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect1">
<a name="ThunarxPropertyPageProvider.object-hierarchy"></a><h2>Object Hierarchy</h2>
<pre class="screen">    <a href="/usr/share/gtk-doc/html/gobject/GTypeModule.html">GInterface</a>
    <span class="lineart">╰──</span> ThunarxPropertyPageProvider
</pre>
</div>
<div class="refsect1">
<a name="ThunarxPropertyPageProvider.prerequisites"></a><h2>Prerequisites</h2>
<p>
ThunarxPropertyPageProvider requires
 GObject.</p>
</div>
<div class="refsect1">
<a name="ThunarxPropertyPageProvider.includes"></a><h2>Includes</h2>
<pre class="synopsis">#include &lt;thunarx/thunarx.h&gt;
</pre>
</div>
<div class="refsect1">
<a name="ThunarxPropertyPageProvider.description"></a><h2>Description</h2>
<p>To add a property page to the file properties dialog, extensions must implement the</p>
<span class="type">ThunarxPropertyPageProvider</span> interface. This interface has only one virtual
<p>method, <code class="function">get_pages</code>, that is passed a list of <a class="link" href="ThunarxFileInfo.html" title="ThunarxFileInfo"><span class="type">ThunarxFileInfo</span></a> objects and returns a list
of <a class="link" href="ThunarxPropertyPage.html" title="ThunarxPropertyPage"><span class="type">ThunarxPropertyPage</span></a> objects.</p>
</div>
<div class="refsect1">
<a name="ThunarxPropertyPageProvider.functions_details"></a><h2>Functions</h2>
<div class="refsect2">
<a name="thunarx-property-page-provider-get-pages"></a><h3>thunarx_property_page_provider_get_pages ()</h3>
<pre class="programlisting"><span class="returnvalue">GList</span> *
thunarx_property_page_provider_get_pages
                               (<em class="parameter"><code><a class="link" href="ThunarxPropertyPageProvider.html" title="ThunarxPropertyPageProvider"><span class="type">ThunarxPropertyPageProvider</span></a> *provider</code></em>,
                                <em class="parameter"><code><span class="type">GList</span> *files</code></em>);</pre>
<p>Returns the list of <a class="link" href="ThunarxPropertyPage.html" title="ThunarxPropertyPage"><span class="type">ThunarxPropertyPage</span></a>s that <em class="parameter"><code>provider</code></em>
 has to offer for <em class="parameter"><code>files</code></em>
.</p>
<p>Extensions that implement this interface, must first check whether they support all the
<a class="link" href="ThunarxFileInfo.html" title="ThunarxFileInfo"><span class="type">ThunarxFileInfo</span></a>s in the list of <em class="parameter"><code>files</code></em>
. Most extensions will probably only support
<a class="link" href="ThunarxPropertyPage.html" title="ThunarxPropertyPage"><span class="type">ThunarxPropertyPage</span></a>s for exactly one file of a certain type. For example an MP3-Tag
editor property page will most probably support only a single audio file, and so the method
would be implemented like this</p>
<div class="informalexample">
  <table class="listing_frame" border="0" cellpadding="0" cellspacing="0">
    <tbody>
      <tr>
        <td class="listing_lines" align="right"><pre>1
2
3
4
5
6
7
8
9
10
11</pre></td>
        <td class="listing_code"><pre class="programlisting"><span class="n">GList</span><span class="o">*</span><span class="w"></span>
<span class="nf">tag_provider_get_pages</span><span class="w"> </span><span class="p">(</span><span class="n">ThunarxPropertyPageProvider</span><span class="w"> </span><span class="o">*</span><span class="n">property_page_provider</span><span class="p">,</span><span class="w"></span>
<span class="w">                        </span><span class="n">GList</span><span class="w">                       </span><span class="o">*</span><span class="n">files</span><span class="p">)</span><span class="w"></span>
<span class="p">{</span><span class="w"></span>
<span class="w">  </span><span class="k">if</span><span class="w"> </span><span class="p">(</span><span class="n">g_list_length</span><span class="w"> </span><span class="p">(</span><span class="n">files</span><span class="p">)</span><span class="w"> </span><span class="o">!=</span><span class="w"> </span><span class="mi">1</span><span class="p">)</span><span class="w"></span>
<span class="w">    </span><span class="k">return</span><span class="w"> </span><span class="nb">NULL</span><span class="p">;</span><span class="w"></span>
<span class="w">  </span><span class="k">else</span><span class="w"> </span><span class="k">if</span><span class="w"> </span><span class="p">(</span><span class="o">!</span><span class="n">thunarx_file_info_has_mime_type</span><span class="w"> </span><span class="p">(</span><span class="n">files</span><span class="o">-&gt;</span><span class="n">data</span><span class="p">,</span><span class="w"> </span><span class="s">&quot;audio/mp3&quot;</span><span class="p">))</span><span class="w"></span>
<span class="w">    </span><span class="k">return</span><span class="w"> </span><span class="nb">NULL</span><span class="p">;</span><span class="w"></span>
<span class="w">  </span><span class="k">else</span><span class="w"></span>
<span class="w">    </span><span class="k">return</span><span class="w"> </span><span class="n">g_list_append</span><span class="w"> </span><span class="p">(</span><span class="nb">NULL</span><span class="p">,</span><span class="w"> </span><span class="n">tag_page_new</span><span class="w"> </span><span class="p">(</span><span class="n">files</span><span class="o">-&gt;</span><span class="n">data</span><span class="p">));</span><span class="w"></span>
<span class="p">}</span><span class="w"></span></pre></td>
      </tr>
    </tbody>
  </table>
</div>

<p>where <code class="function">tag_page_new()</code> allocates a new <span class="type">TagPage</span> instance for a <a class="link" href="ThunarxFileInfo.html" title="ThunarxFileInfo"><span class="type">ThunarxFileInfo</span></a> object
passed to it. See the description of the <a class="link" href="ThunarxPropertyPage.html" title="ThunarxPropertyPage"><span class="type">ThunarxPropertyPage</span></a> class for additional
information about the <span class="type">TagPage</span> example class.</p>
<p>As a special note, this method automatically takes a reference on the
<em class="parameter"><code>provider</code></em>
 for every <a class="link" href="ThunarxPropertyPage.html" title="ThunarxPropertyPage"><span class="type">ThunarxPropertyPage</span></a> object returned from the real implementation
of this method in <em class="parameter"><code>provider</code></em>
. This is to make sure that the extension stays
in memory for atleast the time that the pages are used. If the extension
wants to stay in memory for a longer time, it'll need to take care of this
itself (e.g. by taking an additional reference on the <em class="parameter"><code>provider</code></em>
 itself,
that's released at a later time).</p>
<p>The caller is responsible to free the returned list of pages using
something like this when no longer needed:</p>
<div class="informalexample">
  <table class="listing_frame" border="0" cellpadding="0" cellspacing="0">
    <tbody>
      <tr>
        <td class="listing_lines" align="right"><pre>1
2</pre></td>
        <td class="listing_code"><pre class="programlisting"><span class="n">g_list_foreach</span><span class="w"> </span><span class="p">(</span><span class="n">list</span><span class="p">,</span><span class="w"> </span><span class="p">(</span><span class="n">GFunc</span><span class="p">)</span><span class="w"> </span><span class="n">g_object_ref_sink</span><span class="p">,</span><span class="w"> </span><span class="nb">NULL</span><span class="p">);</span><span class="w"></span>
<span class="n">g_list_free_full</span><span class="w"> </span><span class="p">(</span><span class="n">list</span><span class="p">,</span><span class="w"> </span><span class="n">g_object_unref</span><span class="p">);</span><span class="w"></span></pre></td>
      </tr>
    </tbody>
  </table>
</div>

<p><span class="annotation">[<acronym title="Exposed in C code, not necessarily available in other languages."><span class="acronym">skip</span></acronym>]</span></p>
<div class="refsect3">
<a name="thunarx-property-page-provider-get-pages.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>provider</p></td>
<td class="parameter_description"><p>a <a class="link" href="ThunarxPropertyPageProvider.html" title="ThunarxPropertyPageProvider"><span class="type">ThunarxPropertyPageProvider</span></a>.</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>files</p></td>
<td class="parameter_description"><p>the list of <a class="link" href="ThunarxFileInfo.html" title="ThunarxFileInfo"><span class="type">ThunarxFileInfo</span></a>s
for which a properties dialog will be displayed. </p></td>
<td class="parameter_annotations"><span class="annotation">[<acronym title="Generics and defining elements of containers and arrays."><span class="acronym">element-type</span></acronym> ThunarxFileInfo]</span></td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="thunarx-property-page-provider-get-pages.returns"></a><h4>Returns</h4>
<p>the list of
<a class="link" href="ThunarxPropertyPage.html" title="ThunarxPropertyPage"><span class="type">ThunarxPropertyPage</span></a>s that <em class="parameter"><code>provider</code></em>
has to offer for <em class="parameter"><code>files</code></em>
. </p>
<p><span class="annotation">[<acronym title="The caller owns the data, and is responsible for free it."><span class="acronym">transfer full</span></acronym>][<acronym title="Generics and defining elements of containers and arrays."><span class="acronym">element-type</span></acronym> ThunarxPropertyPage]</span></p>
</div>
</div>
</div>
<div class="refsect1">
<a name="ThunarxPropertyPageProvider.other_details"></a><h2>Types and Values</h2>
<div class="refsect2">
<a name="ThunarxPropertyPageProvider-struct"></a><h3>ThunarxPropertyPageProvider</h3>
<pre class="programlisting">typedef struct _ThunarxPropertyPageProvider ThunarxPropertyPageProvider;</pre>
</div>
<hr>
<div class="refsect2">
<a name="ThunarxPropertyPageProviderIface"></a><h3>struct ThunarxPropertyPageProviderIface</h3>
<pre class="programlisting">struct ThunarxPropertyPageProviderIface {
  GList *(*get_pages) (ThunarxPropertyPageProvider *provider,
                       GList                       *files);
};
</pre>
<p>Interface with virtual methods implemented by extensions that provide
additional pages for the file properties dialog.</p>
<div class="refsect3">
<a name="ThunarxPropertyPageProviderIface.members"></a><h4>Members</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="300px" class="struct_members_name">
<col class="struct_members_description">
<col width="200px" class="struct_members_annotations">
</colgroup>
<tbody><tr>
<td class="struct_member_name"><p><em class="structfield"><code><a name="ThunarxPropertyPageProviderIface.get-pages"></a>get_pages</code></em> ()</p></td>
<td class="struct_member_description"><p>see <a class="link" href="ThunarxPropertyPageProvider.html#thunarx-property-page-provider-get-pages" title="thunarx_property_page_provider_get_pages ()"><code class="function">thunarx_property_page_provider_get_pages()</code></a>.</p></td>
<td class="struct_member_annotations"> </td>
</tr></tbody>
</table></div>
</div>
</div>
</div>
</div>
<div class="footer">
<hr>Generated by GTK-Doc V1.33.1</div>
</body>
</html>